package org.smart4j.framework.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

/**
 *
 * propertties 文件工具类
 *
 * @author: Mr.Zhou
 * @create: 2018-10-24 17:02
 **/
public final class PropsUtil {

    private static final Logger LOGGER= LoggerFactory.getLogger(PropsUtil.class);

    /**
     * 获取配置文件对象
     */
    public static Properties loadProps(String path){
        Properties properties=new Properties();
        try {
            properties.load(PropsUtil.class.getClassLoader().getResourceAsStream(path));
        }catch (Exception e){
            LOGGER.error("get properties failure",e);
            throw new RuntimeException(e);
        }
        return properties;
    }
}
